{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5728"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json\n",
    "with open('jsons/invert_index.json', 'r', encoding='utf-8') as file:\n",
    "    data_dict = json.load(file)\n",
    "len(data_dict['金融'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'南开': 0.0012960562895750964,\n",
       " '数项': 8.59443197175704,\n",
       " '智库': 101.92699177133191,\n",
       " '成果': 27.198459684209368,\n",
       " '获评': 13.72643476650465,\n",
       " 'CTTI': 24.427340544041947,\n",
       " '建设': 14.448666611592989,\n",
       " '最佳': 19.77775364213318,\n",
       " '案例': 45.78040928626659,\n",
       " '与': 2.4245912319510117,\n",
       " '研究': 12.724228198588671,\n",
       " '优秀': 21.896190207075115,\n",
       " '优秀成果': 52.90689926245597,\n",
       " '开大': 0.03677209556960435,\n",
       " '大学': 0.06714069021699712,\n",
       " '南开大学': 0.03677209556960435,\n",
       " '通讯': 1.6189070858441124,\n",
       " '通讯员': 1.658695360783352,\n",
       " '马靖涵': 22.466978602744597,\n",
       " '日前': 4.903253623626705,\n",
       " '由': 2.1193386294390044,\n",
       " '南京': 7.2226294131093525,\n",
       " '南京大学': 8.783747649789413,\n",
       " '和': 1.0973103066506735,\n",
       " '兰州': 19.857572070664148,\n",
       " '兰州大学': 10.739716251548403,\n",
       " '共同': 2.8298125118532282,\n",
       " '主办': 4.49984813388875,\n",
       " '的': 1.060192123204736,\n",
       " '2024': 16.507532654579983,\n",
       " '新型': 5.85156666964557,\n",
       " '治理': 8.436439306838684,\n",
       " '论坛': 10.437666993315858,\n",
       " '在': 0.2806310265373781,\n",
       " '召开': 3.6461386353609146,\n",
       " '发布': 5.409130374160724,\n",
       " '中国': 6.03253884949869,\n",
       " '索引': 11.707183895663677,\n",
       " '年度': 7.957711257226547,\n",
       " '推介': 24.527762588215516,\n",
       " '名单': 14.415997539913214,\n",
       " '示范': 9.046533294664698,\n",
       " '1': 3.837397656079302,\n",
       " '项': 34.70467992353781,\n",
       " '3': 9.736982252644982,\n",
       " '特等': 14.411309469999482,\n",
       " '特等奖': 14.825760485441933,\n",
       " '一等': 10.230730832060326,\n",
       " '一等奖': 10.429314478020853,\n",
       " '2': 4.275997542150115,\n",
       " '二等': 11.293216249353192,\n",
       " '二等奖': 11.413686319710079,\n",
       " '现代': 5.818905987504894,\n",
       " '旅': 5.955374642141781,\n",
       " '\\xa0': 1.7989077207210853,\n",
       " '旅游': 9.368285155193426,\n",
       " '游业': 9.473428622372872,\n",
       " '旅游业': 9.473428622372872,\n",
       " '发展': 5.3140116730654094,\n",
       " '省部': 12.445708014552086,\n",
       " '共建': 5.951688686328141,\n",
       " '协同': 10.838076502708148,\n",
       " '创新': 6.271225682184619,\n",
       " '中心': 13.09121271256815,\n",
       " '科研': 3.3437169114684457,\n",
       " '育人': 2.5692563673067457,\n",
       " '三位': 3.9507281217667054,\n",
       " '一体': 5.782728076077415,\n",
       " '三位一体': 5.063878568880842,\n",
       " '高校': 1.566293864905655,\n",
       " '模式': 2.212495101127035,\n",
       " '荣获': 17.64564066730993,\n",
       " '跨国': 15.210523492012971,\n",
       " '国公': 16.85015461111718,\n",
       " '公司': 9.278141769912171,\n",
       " '跨国公司': 17.100299437934332,\n",
       " '持续': 2.057947434938811,\n",
       " '推动': 3.0380917027819034,\n",
       " '有': 0.8287720187436265,\n",
       " '组织': 1.3491845682529442,\n",
       " '主动': 2.5734086224075132,\n",
       " '服务': 1.2542914896016946,\n",
       " '国家': 2.0723521738728596,\n",
       " '开放': 2.1809730145896826,\n",
       " '战略': 2.0133966379534374,\n",
       " '特色': 3.275637007416664,\n",
       " '社会': 2.7572545861492816,\n",
       " '会主': 4.185426785564049,\n",
       " '主义': 3.2584334742033505,\n",
       " '社会主义': 4.280489402544726,\n",
       " '经济': 2.6989808508400652,\n",
       " '2011': 3.2027543772737572,\n",
       " '计划': 2.064387677412713,\n",
       " '十年': 2.8409527145556166,\n",
       " '集': 3.9715622086695475,\n",
       " '国政': 10.11297631242526,\n",
       " '政府': 9.170914149417461,\n",
       " '中国政府': 14.125378930586507,\n",
       " '联合': 5.6996097397078325,\n",
       " '倾力': 6.270644671112391,\n",
       " '打造': 2.5189217505358137,\n",
       " '数字': 3.20242912113168,\n",
       " '全国': 1.4632474679835323,\n",
       " '全国性': 5.1767052881436735,\n",
       " '比赛': 3.0624551121668175,\n",
       " '赛事': 4.1309899455976495,\n",
       " '建议': 8.647345796680035,\n",
       " '多': 1.3120144938217833,\n",
       " '举措': 2.802725837954448,\n",
       " '促进': 3.5985712743151135,\n",
       " '中间': 4.208840270918662,\n",
       " '中间品': 8.014613476504097,\n",
       " '贸易': 3.57667920989192,\n",
       " '外需': 7.678141239882884,\n",
       " '增长': 2.8454940484277427,\n",
       " '研究院': 2.4839153532893694,\n",
       " '企业': 4.096318184800566,\n",
       " '首席': 3.717055998456666,\n",
       " '执行': 2.9813038653689694,\n",
       " '执行官': 5.891155049407487,\n",
       " '情绪': 4.177314017271888,\n",
       " '特征': 3.338798450946674,\n",
       " '责任': 1.9696081624680857,\n",
       " '深化': 2.382971679625579,\n",
       " '体制': 3.059068148725802,\n",
       " '机制': 2.2068314118294117,\n",
       " '再塑': 7.707128776756137,\n",
       " '城市': 2.475548424693494,\n",
       " '新': 0.9062384124466302,\n",
       " '活力': 3.057941705351271,\n",
       " '天津': 0.9167007549602308,\n",
       " '津市': 1.6245741719927052,\n",
       " '天津市': 1.6250441756942435,\n",
       " '文化': 1.361028127441293,\n",
       " '深度': 5.738428432761547,\n",
       " '融合': 5.214524697863877,\n",
       " '高质': 2.551968816534385,\n",
       " '质量': 1.8749013529359124,\n",
       " '高质量': 2.5642619541005627,\n",
       " '节假': 11.539314992693376,\n",
       " '假日': 11.522437255401647,\n",
       " '节假日': 12.048006297061754,\n",
       " '文旅': 5.167381211268551,\n",
       " '消费': 3.6471929942195778,\n",
       " '制度': 2.2305421706190933,\n",
       " '改革': 1.8034513084862056,\n",
       " '优化': 3.019024140613113,\n",
       " '当前': 2.402361666360214,\n",
       " '内外': 2.4933125714432167,\n",
       " '外贸': 5.333591947789807,\n",
       " '内外贸': 9.441729832144244,\n",
       " '一体化': 3.652789549147735,\n",
       " '现状': 3.2027543772737572,\n",
       " '面临': 2.665412899641491,\n",
       " '困难': 2.627186934884285,\n",
       " '问题': 1.1191737232446093,\n",
       " '政策': 2.054536402637748,\n",
       " '地方': 2.583865322775571,\n",
       " '能力': 1.6056235067955846,\n",
       " '报告': 3.6044957812693714,\n",
       " '2022': 3.5336468939753125,\n",
       " '2023': 3.615729724763793,\n",
       " '教师': 1.5922110253149202,\n",
       " '思政': 3.7845731988280975,\n",
       " '工作': 1.3553010429377834,\n",
       " '业务': 3.1105245861382373,\n",
       " '实践': 1.441827564018427,\n",
       " '本年': 4.467297586711948,\n",
       " '本年度': 4.489430115060951,\n",
       " '征集': 8.078104900543927,\n",
       " '围绕': 1.9448924314303482,\n",
       " '两大': 4.482387832435538,\n",
       " '主题': 1.5018582557823608,\n",
       " '共': 2.29403943920806,\n",
       " '到': 0.9227382587866264,\n",
       " '来自': 3.540737817907199,\n",
       " '306': 15.73238694277165,\n",
       " '家': 5.703315495773475,\n",
       " '机构': 4.909094839061568,\n",
       " '份': 18.210538490328332,\n",
       " '533': 8.835594028573928,\n",
       " '782': 9.441729832144244,\n",
       " '研究成果': 3.1866197904127214,\n",
       " '初审': 6.209608780526022,\n",
       " '专家': 1.7961727320617296,\n",
       " '委员': 1.9710309751340087,\n",
       " '委员会': 2.277138360881427,\n",
       " '终审': 6.744852931640159,\n",
       " '最终': 2.561345749958238,\n",
       " '共有': 2.9748078051080618,\n",
       " '159': 7.707128776756137,\n",
       " '入围': 10.2307842066619,\n",
       " '451': 9.847194940252407,\n",
       " '韦承金': 1.6387712736184359}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "with open('jsons/TF_IDF.json', 'r', encoding='utf-8') as file:\n",
    "    tfidf_dict = json.load(file)\n",
    "tfidf_dict['http://news.nankai.edu.cn/ywsd/system/2024/12/05/030064914.shtml']"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ai_learn",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
